$(function() {
	new Vue({
		el: "#orderListApp",
		data: {
			searchOrder: "",
			activeName: 'first',
			formLabelWidth:"120px",
			fullscreenLoading:false,
			currentPage:1,
			totalSize:1,
			form: {
				name: '',
			    num: '',
				orderNum:"",
			},
			allTableData:[],
		},
		created:function(){
			parent.vueData.$data.hreHtml="../plartOrderList/index.html";
			parent.vueData.activeIndex  = "5";
			parent.vueData.getLeftNav("5")
			parent.vueData.$data.categoryIndex = 2
			this.getAllOrderList(1);
		},
		methods: {
			getAllOrderList(page){
				this.fullscreenLoading = true;
				let shopId = getShopId()
				let param = {
					
					page:page,
					
				}
				axios({
					url: POSTURL.getAllSalesRecord,
					method: 'post',
					data: param
				}).then(response => {
					this.fullscreenLoading = false;
					if (response.data.code == 100) {
						console.log(response.data);
						if(response.data.result){
							if(page === 1){
								if(response.data.result.page<=1){
									this.totalSize = response.data.result.orders.length
								}else{
								   this.totalSize = response.data.result.page*10	
								}
								 this.allTableData.length = 0;
								 this.allTableData=[];
							}
							 this.allTableData = this.allTableData.concat(response.data.result.orders)
							
						}
						
					} else {
						this.$message.error(response.data.message);
					}
				}).catch(error => {
					this.fullscreenLoading = false;
					console.log(error);
					this.$message.error('服务器出错!');
				}) 
			},
			handleClick(){
				
			},
			handleCurrentChange(val){
				this.getAllOrderList(val);
			}

			
			
		}

	})
})
